﻿<controls:MetroContentControl x:Class="Wix.Win8SetupBootstrapper.Views.ConfigurationPageView"
                              xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                              xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                              xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
                              xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
                              xmlns:controls="http://metro.mahapps.com/winfx/xaml/controls"
                              xmlns:viewModels="clr-namespace:Wix.Win8SetupBootstrapper.ViewModels"
                              mc:Ignorable="d"
                              d:DesignHeight="300" d:DesignWidth="450"
                              d:DataContext="{d:DesignInstance viewModels:ConfigurationViewModel }">
    <controls:MetroContentControl.Resources>
        <ResourceDictionary>
            <!-- re-set brushes -->

            <SolidColorBrush x:Key="AccentSelectedColorBrush" Color="Transparent" />
            <SolidColorBrush x:Key="AccentColorBrush" Color="Transparent" />
            <SolidColorBrush x:Key="AccentColorBrush2" Color="Transparent" />
            <SolidColorBrush x:Key="AccentColorBrush3" Color="Transparent" />
            <SolidColorBrush x:Key="AccentColorBrush4" Color="Transparent" />

            <Style TargetType="{x:Type ListViewItem}" BasedOn="{StaticResource MetroListViewItem}" />
            <Style TargetType="{x:Type ListView}" BasedOn="{StaticResource MetroListView}" />

            <Style TargetType="{x:Type GroupBox}" BasedOn="{StaticResource {x:Type GroupBox}}" />

            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary
                    Source="pack://application:,,,/MahApps.Metro;component/Styles/controls.textblock.xaml" />
                <ResourceDictionary
                    Source="pack://application:,,,/MahApps.Metro;component/Styles/controls.textbox.xaml" />
                <ResourceDictionary
                    Source="pack://application:,,,/MahApps.Metro;component/Styles/controls.listview.xaml" />
            </ResourceDictionary.MergedDictionaries>


        </ResourceDictionary>
    </controls:MetroContentControl.Resources>

    <ListView ItemsSource="{Binding ConfigurationGroups}">
        <ListView.ItemTemplate>
            <DataTemplate DataType="viewModels:ConfigurationGroupViewModel">
                <GroupBox>
                    <GroupBox.Header>
                        <StackPanel Orientation="Vertical">
                            <StackPanel.Resources>
                                <Style TargetType="{x:Type TextBlock}" BasedOn="{StaticResource MetroTextBlock}">
                                    <Setter Property="Foreground" Value="Black" />
                                </Style>
                            </StackPanel.Resources>

                            <TextBlock Text="{Binding Name}" />
                            <TextBlock Text="{Binding Description}" />
                        </StackPanel>
                    </GroupBox.Header>

                    <ListView ItemsSource="{Binding ConfiguratinoItems}">
                        <ListView.ItemTemplate>
                            <DataTemplate DataType="viewModels:ConfigurationItemViewModel">
                                <Grid>
                                    <Grid.Resources>
                                        <Style TargetType="{x:Type TextBlock}"
                                               BasedOn="{StaticResource MetroTextBlock}">
                                            <Setter Property="Foreground" Value="Black" />
                                        </Style>
                                    </Grid.Resources>
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition />
                                        <ColumnDefinition />
                                    </Grid.ColumnDefinitions>
                                    <TextBlock Grid.Column="0" Text="{Binding Caption}" />
                                    <TextBox Grid.Column="1" Text="{Binding Value}" />
                                </Grid>
                            </DataTemplate>
                        </ListView.ItemTemplate>
                    </ListView>
                </GroupBox>
            </DataTemplate>
        </ListView.ItemTemplate>
    </ListView>
    <!--
    <Grid Margin="10,0,0,0">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition/>
            <ColumnDefinition/>
        </Grid.ColumnDefinitions>

        <TextBlock Margin="10, 10, 10, 15" VerticalAlignment="Center" Text="SQL Instance: " Grid.Row="0" Grid.Column="0"/>
        <TextBlock Margin="10,15,10,10" VerticalAlignment="Center" Text="Databae Name: " Grid.Row="1" Grid.Column="0"/>

        <TextBox Margin="10,10,10,15" VerticalAlignment="Center" Text="{Binding SqlInstanceName}" Width="150"  Grid.Row="0" Grid.Column="1"/>
        <TextBox Margin="10,10,10,15" VerticalAlignment="Center" Text="{Binding SqlDatbaseName}" Width="150" Grid.Row="1" Grid.Column="1"/>
    </Grid>-->

</controls:MetroContentControl>